<!--
 * @FilePath     : /study_code/layui/12-5-4.html
 * @Description  : lay-verify 属性：预定义表单校验规则
 * @Date         : 2025-04-07 16:07:21
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-07 16:12:00
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>required 必填项</p>
        <input
          type="text"
          name="username"
          lay-verify="required"
          placeholder="请输入"
          autocomplete="off"
          class="layui-input"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>phone 手机号</p>
        <input
          type="text"
          name="username"
          lay-verify="phone"
          placeholder="请输入手机号"
          autocomplete="off"
          class="layui-input"
          value="18715384437"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>email 邮箱</p>
        <input
          type="text"
          name="username"
          lay-verify="email"
          placeholder="请输入邮箱"
          autocomplete="off"
          class="layui-input"
          value="18715384437@163.com"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>url 网址</p>
        <input
          type="text"
          name="username"
          lay-verify="url"
          placeholder="请输入链接"
          autocomplete="off"
          class="layui-input"
          value="https://www.baidu.com"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>number 数字</p>
        <input
          type="text"
          name="username"
          lay-verify="number"
          placeholder="请输入数字"
          autocomplete="off"
          class="layui-input"
          value="8945"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>date 日期</p>
        <input
          type="text"
          name="username"
          lay-verify="date"
          placeholder="请输入日期"
          autocomplete="off"
          class="layui-input"
          value="8945"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>identity 身份证</p>
        <input
          type="text"
          name="username"
          lay-verify="identity"
          placeholder="请输入身份证号码"
          autocomplete="off"
          class="layui-input"
          value="8945"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <hr />
    <form class="layui-form" action="">
      <div class="layui-form-item">
        <p>多条</p>
        <input
          type="text"
          name="username"
          lay-verify="required|phone"
          placeholder="请输入手机号"
          autocomplete="off"
          class="layui-input"
          value="18715384437"
        />
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button type="submit" class="layui-btn" lay-submit lay-filter="demo1">立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>

    <script src="/layui/dist/layui.js"></script>
    <script>
      layui.use(['form'], function () {
        var layer = layui.form
      })
    </script>
  </body>
</html>
